{% extends "../basepage.html" %}
{% block js %}
<script type="text/javascript" language="javascript">
<!--
var formSubmit = function(obj){
    	var formObj = obj.parentNode;
    	while(formObj.nodeName.toLowerCase() != "form"){
        	formObj = formObj.parentNode;
    	}
    	formObj.submit();
	}
	
function aaa()
{
	var table = document.getElementById("TableNew");
	var trNo = table.rows.length;
	for (i=1;i<table.rows.length;i++){
		var str = table.rows[i].cells[3].innerHTML;
		var cd=str.length;
		if(cd>15){
			table.rows[i].cells[3].innerHTML=str.substring(0,15)+"...";
		}
	}
}
-->
</script>
<script language="javascript"><!-- 改变单元格背景色 -->
 function cells_color(){
	var oColor,td=event.srcElement
	 if(td.tagName!="TD")
	   return ;
	if(event.type=="mouseover"){
		oColor="#C5D7EF";
		}
		
	 else{ 
	 	oColor="#ffffff"
	 }
	 tr=td.parentElement
	 for(var i=0;i<tr.cells.length;i++)
		 tr.cells[i].bgColor=oColor
 }

</script>
 <script type="text/javascript" language="javascript">
    for (i=0;i<TableNew.rows.length;i++) 
    {
        if(i%2==0)
        {
            TableNew.rows(i).className = "a1";
        }
        else
        {
            TableNew.rows(i).className = "";
        }
　　}
</script>
<style type="text/css">
.STYLE1 {
	height:25px;
	background-color:#ffffff;
}
</style>
{% endblock %}
{% block body %}
<body  onLoad="aaa();"   style="background:#ececec">
{% endblock %}
{% block navigator %}
<a  href="/contentList/0">资讯内容管理</a> 
 >> <a href="#">订阅资讯</a>  >> <a href="javascript:history.back(-1);">后退</a>
{% endblock %}
{% block content %}
<form  method="get" action="/userSubscribeAdd">
<table align="center" width="90%" border="0"  cellpadding="0" cellspacing="0" >
  <tr align="center">
    <td>资讯编号:
    <input  name="userName" type="hidden" value="{{userName}}"/>
    <input  name="father" type="hidden" value="{{father}}"/>
    <input  name="code" type="text" value="{{code}}"/>
    <input type="submit" name="search" value="搜索"/>
    </td>
  </tr>
</table>
</form>
<table id="TableNew" border="0" width="90%" cellpadding=1 cellspacing=1 bgcolor="#D5E3E6"  onMouseOver="cells_color();" onMouseOut="cells_color();" >
	<tr class="STYLE1">
		<td align="right" colspan="6">
<input name="return" type="button" value="返回" onClick="javascript:history.back(-1);" >		</td>
	</tr>
	<tr  class="STYLE1">
		<td align="center" width="70px">主编号</td>
		<td align="center" width="70px">内容编号</td>
		<td align="center" width="200px">标题</td>
		<td align="center" width="400px">资讯内容</td>
		<td align="center" width="100px">订阅范围</td>
		<td align="center" width="60px">用户订阅</td>
	</tr>
	{%for content in contents%}
    {%if father %}
	<form id="{{content.maincode}}" method="post" action="/subscribeOtherAdd">
    {%else%}
	<form id="{{content.maincode}}" method="post" action="/subscribeAdd">
    {%endif%}
	<tr class="STYLE1">
		<td align="center">{{content.maincode}}<input name="maincode" type="hidden" value="{{content.maincode}}"></td>
		<td align="center">{{content.code}}<input name="code" type="hidden" value="{{content.code}}">
                                            <input name="father" type="hidden" value="{{content.father}}">
                                            <input name="level" type="hidden" value="{{content.level}}">
        </td>
		<td align="center">{{content.title}}</td>
		<td align="center">{{content.content}}</td>
		<td align="center"><select name="subscribeType">
			<option value="0">下面的全要</option>
			<option value="1">下面的另外订阅</option>
		</select></td>
		<td align="center"><input name="userName" type="hidden" value="{{userName}}"/><input type="button" onClick="formSubmit(this);" value="确定"></td>
	</tr>
	</form>
	{%endfor%}
</table>
{% endblock %}